<!-- @ftlvariable name="zkServiceType" type="com.gxp.web.domain.ZkServiceType" -->
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改服务类型')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-svtype-edit" th:object="${zkServiceType}">
        <input name="svtypeId" th:field="*{svtypeId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">name：</label>
            <div class="col-sm-8">
                <input name="svtypeName" th:field="*{svtypeName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">描述：</label>
            <div class="col-sm-8">
                <input name="svtypeDescription" th:field="*{svtypeDescription}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <label class="toggle-switch switch-solid">
                    <input type="checkbox" id="status" th:checked="*{isLock==0}">
                    <span></span>
                </label>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/svtype";
    $("#form-svtype-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $('#form-svtype-edit').serializeArray();
            var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
            data.push({"name": "svtypeStatus", "value": status});
            $.operate.save(prefix + "/edit", data);
        }
    }
</script>
</body>
</html>